/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.bits;

/**
 * <b>(DianlanBmsSuspendFailureReasonBits)</b>
 * <p>
 * BMS 中止充电错误原因
 * <p>
 * 1-2 位——电流过大
 * 3-4 位——电压异常
 * 5-8 位——预留位
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/24
 */
@SuppressWarnings("unused")
public class DianlanBmsSuspendFailureReasonBits {

    public String parseReason(int bit) {
        return switch (bit) {
            case 0, 1 -> "电流过大";
            case 2, 3 -> "电压异常";
            case 4, 5 -> "预留位";
            default -> "";
        };
    }
}